package br.ufrj.dcc.xml.database;

public class DatabaseSettings {
	private static DatabaseSettings instance;
	
	private String driverClass = "org.postgresql.Driver";
	private String user = "postgres";
	private String password = "postgres";
	private String url = "";
	
	private String urlBase = "jdbc:postgresql://";
	private String host = "146.164.41.223";
	private String schema = "grupo5";
	
	private void mountUrl(){
		this.url = urlBase + host + "/" + schema;
	}
	
	public String getUrl(){
		mountUrl();
		return this.url;
	}
	
	public String getDriverClass() {
		return driverClass;
	}
	public void setDriverClass(String driverClass) {
		this.driverClass = driverClass;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getUser() {
		return user;
	}
	public void setUser(String user) {
		this.user = user;
	}
		
	public static DatabaseSettings getInstance(){
		if(instance == null){
			instance = new DatabaseSettings();
		}
		return instance;
	}
	
	public static void setInstance(DatabaseSettings dbS){
		instance = dbS;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public String getSchema() {
		return schema;
	}

	public void setSchema(String schema) {
		this.schema = schema;
	}
}
